package net.xxcxcxcx.xc_enhancedmob.event;

import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.ActionResult;

/**
 * 被动技能事件
 */
public interface passiveApplyCallback {
    Event<passiveApplyCallback> EVENT = EventFactory.createArrayBacked(passiveApplyCallback.class,
            (listeners) -> (mobEntity) -> {
                for (passiveApplyCallback listener : listeners) {
                    ActionResult result = listener.passiveApply(mobEntity);
                    if (result != ActionResult.PASS) {
                        return result;
                    }
                }
                return ActionResult.PASS;
            }
    );

    ActionResult passiveApply(LivingEntity livingEntity);
}
